<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">

body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
	font-size:13px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
*{font-family:Tahoma, Arial, Helvetica, Sans-serif,"宋体";}
table{
	width:85%;
	margin:0px auto;
	font:Georgia 11px;
	font-size:12px;
	color:#333333;
	text-align:center;
	border:1px solid #999;/*细线表格线条颜色*/
	border-collapse:collapse;/*细线表格代码*/
}
td{
	border:1px solid #999;/*细线表格线条颜色*/
	height:22px;
}
caption{text-align:center;font-size:12px;font-weight:bold;margin:0 auto;}
tr.t1 td {background-color:#fff;}
tr.t2 td {background-color:#eee;}
tr.t3 td {background-color:#ccc;}
th,tfoot tr td{font-weight:bold;text-align:center;background:#c5c5c5;}
th{line-height:30px;height:30px;}
tfoot tr td{background:#fff;line-height:26px;height:26px;}
thead{border:1px solid #999;}
thead tr td{text-align:center;}

a{
	text-decoration:none;
	}
	img{
		border:0px;}
		select{
			font-size:12px;}
		

</style>
<script src="../admin_core/templates/admin/js/list.js"></script>
<script src="js/registAjax.js" type="text/javascript"></script>
<script type="text/javascript">
function selectPage(obj)
{

	var value = obj.value;
	document.location.href="control.php?action=studentList&page="+value+"&countPage=#{$countPage}#&count=#{$count}#&xyId=#{$xyId}#&zhyId=#{$zhyId}#&bjId=#{$bjId}#&xsName=#{$xsName}#";
	}
	function readDepartment(xyId)
		{
			window.open('../readDepartment.php?xyId='+xyId,'查看学院/部门信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
			}
	function look()
	{
		var xyId = document.getElementById('xyId').value;
		var zhyId = document.getElementById('zhy').value;
		var bjId = document.getElementById('bj').value;
		var xsName = document.getElementById('xsName').value;
		/*判断用户是否确定至少一个条件*/
		if(xyId == "none"&&xsName=="")
		{
			alert("请确定查看的条件！");
		}
		/*查找一个班级、专业或者一个学院的所有学生集合*/
		else if(xsName == ""&&xyId!="none")
		{
			if(bjId!="none")
			{
		    document.location.href="control.php?action=studentList&xyId="+xyId+"&zhyId="+zhyId+"&bjId="+bjId;
			}
			else if(bjId=="none"&&zhyId!="none")
			{
				document.location.href="control.php?action=studentList&xyId="+xyId+"&zhyId="+zhyId;
				}
				else if(zhyId == "none")
				{
					document.location.href="control.php?action=studentList&xyId="+xyId;
					}
			}
			/*查找一个班级、专业或者一个学院的包含用户输入的学生姓名所有学生集合*/
			else if(xsName !=""&&xyId!="none")
			{
		     if(bjId!="none")
			{
		    document.location.href="control.php?action=studentList&xyId="+xyId+"&zhyId="+zhyId+"&bjId="+bjId+"&xsName="+xsName;
			}
			else if(bjId=="none"&&zhyId!="none")
			{
				document.location.href="control.php?action=studentList&xyId="+xyId+"&zhyId="+zhyId+"&xsName="+xsName;
				}
				else if(zhyId == "none")
				{
					document.location.href="control.php?action=studentList&xyId="+xyId+"&xsName="+xsName;
					}
				}
				/*向全校查找包含给姓名的学生集合*/
				else if(xsName !="" &&xyId=="none")
				{
					document.location.href="control.php?action=studentList&xsName="+xsName;
					}
	
	}
	function checkChecked()
	{
		var logList =  document.getElementsByName("xsId[]");
		var checkState = false;
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			if(obj.checked)
				{
				checkState = true;
				}
			
			}
		if(!checkState)
			{
			alert("至少选中一个！");
			}
		else
			{
			if(confirm("确认删除吗？"))
			document.getElementById('selectForm').submit();
			}
	}
	function checkStudentDetail(xsId)
	{
		window.open('../readStudentDetail.php?xsId='+xsId,'学生信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
		}
		function select()
	{
		var logList =  document.getElementsByName("xsId[]");
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			obj.checked =!obj.checked;
			}
		
	}
</script>
</head>

<body style="text-align:center;">
<center>
<br />

<fieldset  style=" width:1110px;">
<legend><img src="images/311.gif"/>&nbsp;<span style="color:#333; font-size:15px; font-weight:bold;">学生列表</span></legend>
<!--<div style=" text-align:left; width:850px; margin:auto; color:#F00;">
以下选项中<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1）如果你未选择任何一个则是查看所有的学生
&nbsp;2）如果只选择学院则查看被选学院的学生
&nbsp;3）如果只选择某个学院下的某个专业而为选择班级则查看该专业的学生
&nbsp;4）如果你做出了选择则查看所选班级的学生&nbsp;5）如果你为选择学生</div>

<br />-->
<span style=" font-size:13px; font-weight:bold;">可选择一下情况查看:</span><span>
学院：<select name="xyId" id="xyId" style="text-align:center; width:150px;" onchange="getZhy(this)">
  <option value="none" selected="selected">====请 选 择====</option>
  
#{foreach from=$xyList item=xy}#

  <option  value="#{$xy->getXy_id()}#">#{$xy->getXy_name()}#</option>
  
#{/foreach}#

</select>
</span>&nbsp;&nbsp;<span id="zhySpan">
专业：
<select class="textFile" name="zhy" id="zhy" style="text-align:center; width:150px;" onchange="getBJ(this)"  >
  <option style=" text-align:center;" value="none">====请 选 择====</option>
</select>
</span>
&nbsp;&nbsp;
<span id="bjSpan">
班级：<select class="textFile" name="bj" id="bj" style="text-align:center; width:150px;" >
<option style=" text-align:center;" value="none">====请 选 择====</option>
</select>
</span>&nbsp;&nbsp;
<span >
学生：<input name="xsName" id="xsName" type="text" width="150"  height="20"/>
</span>&nbsp;&nbsp;
<input type="button" value=" 查 看 " onclick="look()"  style="width:50px; height:25px;"/>
<br />
<form id="selectForm" action="control.php?action=deletXSBatch" method="post">
  <table>
    <caption style="font-size:14px;">
      #{$searchContent}#所有学生列表
      </caption>
    <thead>
      <tr>
        <th width="10%" onclick="select()" style="cursor: pointer;" title="全选/反选">全选/反选</th>
        <th>学生姓名</th>
        <th>所属学院/部门</th>
        <th>性别</th>
        <th>联系电话</th>
        <th>联系邮箱</th>
        <th>操作</th>
      </tr>
    </thead>
  #{if $count==0}#
  <tr>
   <td colspan="7" align="center" style="text-align:center; border:1px solid #999;"> 暂无数据！</td>
  </tr>
  #{else}#
    #{foreach from=$list item=xs}#
  <tr onmousemove="changeBackColor(this)" onmouseout="removeBackColor(this)">
    <td width="10%" align="center"><input name="xsId[]" type="checkbox" value="#{$xs->getXs_id()}#" /></td>
    <td width="15%" align="left" style="padding-left:5px;"> #{$xs->getXs_name()}# </td>
    <td width="15%" align="left" style="padding-left:5px; cursor:pointer;" onclick="readDepartment(#{$xs->getXy()->getXy_id()}#)" title="查看学院/部门信息">#{$xs->getXy()->getXy_name()}#</td>
    <td width="5%" align="center"> #{if $xs->getXs_xb()==1}#
      男
      #{else}#
      女
      #{/if}# </td>
    <td width="15%" align="center">#{$xs->getXs_tele()}#</td>
    <td width="20%" align="left" style="padding-left:5px;">#{$xs->getXs_email()}#</td>
    <td><a href="#" onclick="checkStudentDetail(#{$xs->getXs_id()}#)"> <img src="images/view_16x16.gif" title="获取该学生详细信息" width="14" height="14"/>查看详细信息</a></td>
  </tr>
    #{/foreach}#
  
  <tr>
    <td align="center" style="border-right:0px; cursor: pointer;"  onclick="select()" title="全选/反选"> 全选/反选 </td>
    <td colspan="7" align="left" style="text-align:left; border-left:0px;"><input type="button" value=" 删除选中记录 "   style="font-size:13px; width:100px; height:25px;" onclick="checkChecked()"/></td>
  </tr>
    #{/if}#
  <tr>
    <td colspan="7" align="right" style="text-align:right; border:1px solid #999;"> 共有#{$count}#条记录 总共有#{$countPage}#页 当前为#{$start}#-#{$end}#条 在第#{$nowPage}#页
      #{if $nowPage==1}#
      上一页
      #{else}# <a href="control.php?action=studentList&page=#{$nowPage-1}#&countPage=#{$countPage}#&count=#{$count}#&xyId=#{$xyId}#&zhyId=#{$zhyId}#&bjId=#{$bjId}#&xsName=#{$xsName}#">上一页</a> #{/if}#
      
      #{if $countPage>$nowPage}# <a href="control.php?action=studentList&page=#{$nowPage+1}#&countPage=#{$countPage}#&count=#{$count}#&xyId=#{$xyId}#&zhyId=#{$zhyId}#&bjId=#{$bjId}#&xsName=#{$xsName}#"> 下一页</a> #{else}#
      下一页
      #{/if}#
      跳至
      <select name="select" onchange="selectPage(this)">
        
  #{section loop=$countPage name=a}#

        <option value="#{$smarty.section.a.iteration}#" #{if $smarty.section.a.iteration==$nowPage}# selected="selected"#{/if}#>#{$smarty.section.a.iteration}#页</option>
        
#{/section}#

      </select>
      &nbsp;&nbsp; </td>
  </tr>
  </table>
</form>
</fieldset>
</center>
</body>
</html>
